<?php

header("content-type:text/html;charset=utf-8");


class Car {
	public $carMode;
	public $carBand;
	public $weight;
	public $speed;

function car($m,$b,$w,$s){
	$this->carMode = $m;
	$this->carBand = $b;
	$this->weight = $w;
	$this->speed = $s;
}


	function getWeight(){
		return $this->weight;
	}
	function getSpeed(){
		return $this->speed;
	}
}

$car1 = new car("Z4","BMW",1.7,200);
echo "<pre>";
print_r($car1);
echo $car1->getWeight();
echo $car1->getSpeed();


class BMWCar extends car {}

$bmw1 = new BMWCar("M3","BMW",2,200);
echo "<pre>";
print_r($bmw1);
echo $car1->getSpeed();
?>